<?php

/**
 * BackendBlogComment form.
 *
 * @package    HugoHamon
 * @subpackage form
 * @author     Hugo Hamon <hugo.hamon@sensio.com>
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class BackendBlogCommentForm extends BaseBlogCommentForm
{
  public function configure()
  {
    $this->widgetSchema['blog_post'] = new sfWidgetFormInputTextPlain(array(
      'value' => $this->getObject()->getPost()->getTitle()
    ));
    $this->validatorSchema['blog_post'] = new sfValidatorPass();

    $this->widgetSchema['name']->setLabel('Author');

    $this->widgetSchema['name']->setAttribute('size', 30);
    $this->widgetSchema['email']->setAttribute('size', 45);
    $this->widgetSchema['web_site_uri']->setAttribute('size', 60);
    $this->widgetSchema['source_content']->setAttributes(array('class' => 'markItUp', 'cols' => 85, 'rows' => 10));

    $this->widgetSchema->setHelp('source_content', 'Write your content with the markdown editor.');
    $this->widgetSchema->setHelp('is_published', 'Tick the box to publish the comment.');
    
    $this->useFields(array(
      'blog_post',
      'name',
      'email',
      'web_site_uri',
      'source_content',
      'is_published'
    ), true);
  }
}
